package itdep.domain.profile;

import itdep.domain.CodedEntity;
import itdep.domain.TranslationType;
import itdep.domain.address.City;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;

import javax.persistence.*;

/**
 * @author Ivan Khalopik
 * @version $Revision: 52 $ $Date: 2010-07-06 10:22:21 +0000 (Tue, 06 Jul 2010) $
 */
@Entity
@Table(name = "ORGANIZATION")
public class Organization extends CodedEntity {

	@Type(type = "ga.hibernate.OrderedEnumUserType", parameters = {@Parameter(name = "enumClass", value = "itdep.domain.profile.OrganizationType")})
	@Column(name = "ORGANIZATION_TYPE", nullable = false)
	private OrganizationType type = OrganizationType.UNKNOWN;

	@ManyToOne
	@JoinColumn(name = "ID_CITY", nullable = false)
	private City city;

	public Organization() {
		super("education-institution", TranslationType.STANDARD);
	}

	public OrganizationType getType() {
		return type;
	}

	public void setType(OrganizationType type) {
		this.type = type;
	}

	public City getCity() {
		return city;
	}

	public void setCity(City city) {
		this.city = city;
	}
}
